﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true"
    CodeBehind="Find.aspx.cs" Inherits="Yonkly.Views.User.Find" %>

<%@ Import Namespace="Yonkly.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <h2>
        Search results</h2>
    <% foreach (var item in ((SearchResults)ViewData.Model).Items)
       { %>
    <div>
        <table>
            <tr>
                <td>
                    <% Html.RenderPartial("~/views/shared/gravatarcontrol.ascx", new GravatarData { UserName = item.Username, Email = item.Email });%>
                </td>
                <td>
                    <% Html.RenderPartial("~/views/shared/usernamecontrol.ascx", new ViewDataDictionary { { "Username", item.Username } }); %><br />
                    <% Html.RenderPartial("~/views/shared/followlink.ascx", new FollowLinkViewData(ViewData.Model) { FriendId = item.UserId });%>
                </td>
            </tr>
        </table>
    </div>
    <%}
       if (((SearchResults)ViewData.Model).Items.Count == 0)
       {%>
    <h3>
        I looked hard but couldn't find anyone. Are you sure he/she is not an imaginary
        friend?</h3>
    <%} %>
</asp:Content>
